//package com.spark.basecommon.config;
//
//import com.spark.basecommon.api.R;
//import com.spark.basecommon.exception.BusinessException;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * @author fuqiang
// * @Description 全局异常处理类 转移到各个服务中 或者抽离出去 因为和gateway会有冲突
// * @Date 2020/8/12
// */
//@ControllerAdvice
//@Slf4j
//public class GlobeExceptionHandle {
//
//    @ExceptionHandler(value = BusinessException.class)
//    @ResponseBody
//    public R handBusinessException(HttpServletRequest req, BusinessException e) {
//        log.error("运行出错: {}", e.getMessage());
//        return R.failed(e.getCode(),e.getMsg());
//    }
//
//    @ExceptionHandler(value = Exception.class)
//    @ResponseBody
//    public R handException(Exception e) {
//        log.error("运行出错: {}", e.getMessage());
//        return R.failed(e.getMessage());
//    }
//}
